package encore.web;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.web.context.WebApplicationContext;

/**
 * Portal 运行类加载实现
 * @author Plex
 *
 */
public abstract class ContextLoader {

	public static final String PORTALCONTEXTID=ContextLoader.class.toString()+"Encore";
	
	protected static final Map<ClassLoader, WebApplicationContext> currentContextPerThread=new ConcurrentHashMap<ClassLoader, WebApplicationContext>(1); 
	
	public static WebApplicationContext getCurrentWebApplicationContext() {
		return currentContextPerThread.get(Thread.currentThread().getContextClassLoader());
	}
}
